package cn.fzm.controller;

import cn.fzm.domain.Account;
import cn.fzm.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author Dremeue
 * @create 2019/10/8 13:14
 **/
@Controller
@RequestMapping("/account")
public class AccountController {

    @Autowired
    private AccountService accountService;

    @RequestMapping("/findAll")
    public @ResponseBody List<Account> findAll() {
        List<Account> list = accountService.findAll();
        System.out.println("表现层：查询所有账户...");
        System.out.println(list);
        return list;
    }
}
